Articles tagged with Hash Table
- Make Sum Divisible by P - Two Sum logic on prefix mod, published 2024-10-06
- LRU Cache - Implementing an LRU Cache in C++: Step-by-Step Guide with Code Examples, published 2024-07-11
- Most Frequent Subtree Sum - Plain and simple DFS, published 2024-05-08
- Maximum Good Subarray Sum - Prefix Sum + HashMap, published 2024-02-05
- Number of Submatrices That Sum to Target - Subarray target sum properly explained, published 2024-01-28
- Insert Delete GetRandom O(1) - Swap with last element, published 2024-01-16
- Partition Labels - Greedy logic, published 2023-12-23
- Bus Routes - BFS solution with intuition, published 2023-11-12
- Restore the Array From Adjacent Pairs - Create graph and run DFS, published 2023-11-10
- Binary Trees With Factors - DP on sorted array, published 2023-10-26
- Valid Number - DFA using hashmap, published 2023-06-15
- Extra Characters in a String - Top-down and Bottom-up DP, published 2023-05-29
- Smallest Number in Infinite Set - Hashset, Min heap based solutions, published 2023-04-25
- Reduction Operations to Make the Array Elements Equal - Sort and count using hashmap [Short + Easy], published 2023-04-19
- Cousins in Binary Tree II - DFS solution + BFS solution, published 2023-04-15
- Substring XOR Queries - Clean HashMap solution, published 2023-02-13
- Naming a Company - HashSet for all letters, published 2023-02-09
- Subarrays with K Different Integers - Sliding window + HashMap, published 2023-02-07
- Fruit Into Baskets - Reaching the best solution, published 2023-02-07
- Word Break II - Word Break extension (DP), published 2023-01-27
- Odd String Difference - O(1) space + 100% faster, published 2022-11-12
- Partition Labels - Greedy Solution, published 2022-10-25
- Word Break - Easy Concise DP, published 2022-10-21
- Insert Delete GetRandom O(1) - Simple Hashset, published 2022-10-21
- Fraction to Recurring Decimal - [Faster than 100%] Easy + Concise C++ Step by step, published 2022-10-21
- Contains Duplicate II - Hashset, published 2022-10-21
- Top K Frequent Words - [C++,Python(3/1 lines)] Two methods: Sorting / Max heap, published 2022-10-19
- Copy List with Random Pointer - C++ Hashmap, published 2022-10-11
- Time Based Key-Value Store - HashMap + Ordered Map, published 2022-10-06
- Group Anagrams - Easy hashmap, published 2022-10-04
- Longest String Chain - Very Easy Hashmap solution + Analysis, published 2022-06-15
- Next Greater Element I - Stack + HashMap O(N1+N2) solution, published 2022-06-02
- Linked List Cycle II - Floyd's Tortoise and Hare Algorithm, published 2022-05-10
- Letter Combinations of a Phone Number - Iterative solution, published 2022-05-09
- Max Number of K-Sum Pairs - Two Sum Approach, published 2022-05-04
- Smallest String With Swaps - DFS solution, published 2022-04-27
- Encode and Decode TinyURL - Easy HashMap solution, published 2022-04-23
- 3Sum With Multiplicity - 3 Sum over keys, published 2022-04-23
- Design HashSet - Hashing using modulo, published 2022-04-21
- Design HashMap - Hashing using modulo, published 2022-04-21
- Top K Frequent Words - 3 line simplest O(n log n ) solution by sorting, published 2022-03-27
- Delete and Earn - House Robber, published 2022-03-05
- Check If a String Contains All Binary Codes of Size K - HashSet 2 solutions O(n) and O(nk), published 2022-02-13
- Subarray Sum Equals K - O(N) HashMap cummulative sum, published 2022-02-11
- Permutation in String - Sliding window, published 2022-02-11
- Contiguous Array - Well-explained HashMap concise with pseudocode, published 2022-02-04
- 4Sum II - Easy O(N^2) solution using HashMap, published 2022-02-03
- Find All Anagrams in a String - Simplest solution ever, published 2022-02-02
- Linked List Cycle II - An easy and a difficult solution, published 2022-01-19
- Construct Binary Tree from Preorder and Inorder Traversal - Two easy to understand recursive solutions, published 2022-01-06
- Find All Possible Recipes from Given Supplies - Two ways to do topological sort, published 2021-12-29